﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage1.Master" AutoEventWireup="true" CodeBehind="DataBase.aspx.cs" Inherits="WebApplicationTest.DataBase" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder" runat="server">
    <form id="form1" runat="server">
        <br />
        <asp:Label ID="Label1" runat="server" Text="数据库DataBase1表1 数据信息："></asp:Label>
        <br />
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Data Source=.\JSQL2008;Initial Catalog=DataBase1;User ID=sa;Password=Sa12345789"  ProviderName="System.Data.SqlClient" SelectCommand="SELECT ID, 帐号, 其他信息 FROM 数据表1" ></asp:SqlDataSource>
        <br />
        SelectCommand显示信息：<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1">
        </asp:GridView>
        <br />
        <br />
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="Data Source=.\JSQL2008;Initial Catalog=DataBase1;User ID=sa;Password=Sa12345789"  ProviderName="System.Data.SqlClient" SelectCommand="SELECT ID, 帐号, 其他信息 FROM 数据表1" UpdateCommand="UPDATE 数据表1 SET ID = @ID, 帐号 = @帐号, 其他信息 = @其他信息 WHERE ID= @ID" ></asp:SqlDataSource>
        <asp:Label ID="Label2" runat="server" Text="SelectCommand显示信息、UpdateCommand更新信息："></asp:Label>
        <br />
        <asp:GridView ID="GridView2" runat="server" DataSourceID="SqlDataSource2" AutoGenerateEditButton="True" AutoGenerateDeleteButton="True">
            
        </asp:GridView>
        <br />
        <br />
    </form>
</asp:Content>
